﻿<div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">SELECT</span> <span style="color:Magenta;">ABS</span>(-1.0), <span style="color:Magenta;">ABS</span>(0.0), <span style="color:Magenta;">ABS</span>(1.0)

<span style="color:Blue;">SET</span> <span style="color:Blue;">NOCOUNT</span> <span style="color:Blue;">OFF</span>;
<span style="color:Blue;">DECLARE</span> @angle <span style="color:Blue;">float</span>;
<span style="color:Blue;">SET</span> @angle = -1.0;
<span style="color:Blue;">SELECT</span> <span style="color:#A31515;">'The ACOS of the angle is: '</span> + <span style="color:Magenta;">CONVERT</span>(<span style="color:Blue;">varchar</span>, <span style="color:Magenta;">ACOS</span>(@angle));

<span style="color:Green;">/* The first value will be -1.01. This fails because the value is 
outside the range.*/</span>
<span style="color:Blue;">DECLARE</span> @angle <span style="color:Blue;">float</span>
<span style="color:Blue;">SET</span> @angle = -1.01
<span style="color:Blue;">SELECT</span> <span style="color:#A31515;">'The ASIN of the angle is: '</span> + <span style="color:Magenta;">CONVERT</span>(<span style="color:Blue;">varchar</span>, <span style="color:Magenta;">ASIN</span>(@angle))
GO

<span style="color:Green;">-- The next value is -1.00.</span>
<span style="color:Blue;">DECLARE</span> @angle <span style="color:Blue;">float</span>
<span style="color:Blue;">SET</span> @angle = -1.00
<span style="color:Blue;">SELECT</span> <span style="color:#A31515;">'The ASIN of the angle is: '</span> + <span style="color:Magenta;">CONVERT</span>(<span style="color:Blue;">varchar</span>, <span style="color:Magenta;">ASIN</span>(@angle))
GO

<span style="color:Green;">-- The next value is 0.1472738.</span>
<span style="color:Blue;">DECLARE</span> @angle <span style="color:Blue;">float</span>
<span style="color:Blue;">SET</span> @angle = 0.1472738
<span style="color:Blue;">SELECT</span> <span style="color:#A31515;">'The ASIN of the angle is: '</span> + <span style="color:Magenta;">CONVERT</span>(<span style="color:Blue;">varchar</span>, <span style="color:Magenta;">ASIN</span>(@angle))
GO

<span style="color:Blue;">SELECT</span> <span style="color:#A31515;">'The ATAN of -45.01 is: '</span> + <span style="color:Magenta;">CONVERT</span>(<span style="color:Blue;">varchar</span>, <span style="color:Magenta;">ATAN</span>(-45.01))
<span style="color:Blue;">SELECT</span> <span style="color:#A31515;">'The ATAN of -181.01 is: '</span> + <span style="color:Magenta;">CONVERT</span>(<span style="color:Blue;">varchar</span>, <span style="color:Magenta;">ATAN</span>(-181.01))
<span style="color:Blue;">SELECT</span> <span style="color:#A31515;">'The ATAN of 0 is: '</span> + <span style="color:Magenta;">CONVERT</span>(<span style="color:Blue;">varchar</span>, <span style="color:Magenta;">ATAN</span>(0))
<span style="color:Blue;">SELECT</span> <span style="color:#A31515;">'The ATAN of 0.1472738 is: '</span> + <span style="color:Magenta;">CONVERT</span>(<span style="color:Blue;">varchar</span>, <span style="color:Magenta;">ATAN</span>(0.1472738))
<span style="color:Blue;">SELECT</span> <span style="color:#A31515;">'The ATAN of 197.1099392 is: '</span> + <span style="color:Magenta;">CONVERT</span>(<span style="color:Blue;">varchar</span>, <span style="color:Magenta;">ATAN</span>(197.1099392))
GO

<span style="color:Blue;">DECLARE</span> @x <span style="color:Blue;">float</span>
<span style="color:Blue;">DECLARE</span> @y <span style="color:Blue;">float</span>
<span style="color:Blue;">SET</span> @x = 35.175643
<span style="color:Blue;">SET</span> @y = 129.44
<span style="color:Blue;">SELECT</span> <span style="color:#A31515;">'The ATN2 of the angle is: '</span> + <span style="color:Magenta;">CONVERT</span>(<span style="color:Blue;">varchar</span>,<span style="color:Magenta;">ATN2</span>(@x,@y ))
GO

<span style="color:Blue;">SELECT</span> <span style="color:Magenta;">CEILING</span>($123.45), <span style="color:Magenta;">CEILING</span>($-123.45), <span style="color:Magenta;">CEILING</span>($0.0)
GO

<span style="color:Blue;">DECLARE</span> @angle <span style="color:Blue;">float</span>
<span style="color:Blue;">SET</span> @angle = 14.78
<span style="color:Blue;">SELECT</span> <span style="color:#A31515;">'The COS of the angle is: '</span> + <span style="color:Magenta;">CONVERT</span>(<span style="color:Blue;">varchar</span>,<span style="color:Magenta;">COS</span>(@angle))
GO

<span style="color:Blue;">DECLARE</span> @angle <span style="color:Blue;">float</span>
<span style="color:Blue;">SET</span> @angle = 124.1332
<span style="color:Blue;">SELECT</span> <span style="color:#A31515;">'The COT of the angle is: '</span> + <span style="color:Magenta;">CONVERT</span>(<span style="color:Blue;">varchar</span>,<span style="color:Magenta;">COT</span>(@angle))
GO

<span style="color:Blue;">SELECT</span> <span style="color:#A31515;">'The number of degrees in PI/2 radians is: '</span> + 
<span style="color:Magenta;">CONVERT</span>(<span style="color:Blue;">varchar</span>, <span style="color:Magenta;">DEGREES</span>((<span style="color:Magenta;">PI</span>()/2)));
GO

<span style="color:Blue;">DECLARE</span> @var <span style="color:Blue;">float</span>
<span style="color:Blue;">SET</span> @var = 10
<span style="color:Blue;">SELECT</span> <span style="color:#A31515;">'The EXP of the variable is: '</span> + <span style="color:Magenta;">CONVERT</span>(<span style="color:Blue;">varchar</span>,<span style="color:Magenta;">EXP</span>(@var))
GO

<span style="color:Blue;">SELECT</span> <span style="color:Magenta;">FLOOR</span>(123.45), <span style="color:Magenta;">FLOOR</span>(-123.45), <span style="color:Magenta;">FLOOR</span>($123.45)

<span style="color:Blue;">DECLARE</span> @var <span style="color:Blue;">float</span>
<span style="color:Blue;">SET</span> @var = 10
<span style="color:Blue;">SELECT</span> <span style="color:#A31515;">'The LOG of the variable is: '</span> + <span style="color:Magenta;">CONVERT</span>(<span style="color:Blue;">varchar</span>, <span style="color:Magenta;">LOG</span>(@var))
GO

<span style="color:Blue;">DECLARE</span> @var <span style="color:Blue;">float</span>
<span style="color:Blue;">SET</span> @var = 145.175643
<span style="color:Blue;">SELECT</span> <span style="color:#A31515;">'The LOG10 of the variable is: '</span> + <span style="color:Magenta;">CONVERT</span>(<span style="color:Blue;">varchar</span>,<span style="color:Magenta;">LOG10</span>(@var))
GO

<span style="color:Blue;">SELECT</span> <span style="color:Magenta;">PI</span>()
GO

<span style="color:Blue;">SELECT</span> <span style="color:Magenta;">POWER</span>(2.0, -100.0)
GO

<span style="color:Blue;">SELECT</span> <span style="color:Magenta;">RADIANS</span>(1e-307)
GO

<span style="color:Blue;">DECLARE</span> @counter <span style="color:Blue;">smallint</span>
<span style="color:Blue;">SET</span> @counter = 1
<span style="color:Blue;">WHILE</span> @counter &lt; 5
    <span style="color:Blue;">BEGIN</span>
        <span style="color:Blue;">SELECT</span> <span style="color:Magenta;">RAND</span>() Random_Number
        <span style="color:Blue;">SET</span> @counter = @counter + 1
    <span style="color:Blue;">END</span>
GO

<span style="color:Blue;">SELECT</span> <span style="color:Magenta;">ROUND</span>(123.9994, 3), <span style="color:Magenta;">ROUND</span>(123.9995, 3)
GO

<span style="color:Blue;">DECLARE</span> @value <span style="color:Blue;">real</span>
<span style="color:Blue;">SET</span> @value = -1
<span style="color:Blue;">WHILE</span> @value &lt; 2
    <span style="color:Blue;">BEGIN</span>
        <span style="color:Blue;">SELECT</span> <span style="color:Magenta;">SIGN</span>(@value)
        <span style="color:Blue;">SET</span> <span style="color:Blue;">NOCOUNT</span> <span style="color:Blue;">ON</span>
        <span style="color:Blue;">SELECT</span> @value = @value + 1
        <span style="color:Blue;">SET</span> <span style="color:Blue;">NOCOUNT</span> <span style="color:Blue;">OFF</span>
    <span style="color:Blue;">END</span>
<span style="color:Blue;">SET</span> <span style="color:Blue;">NOCOUNT</span> <span style="color:Blue;">OFF</span>
GO

<span style="color:Blue;">DECLARE</span> @angle <span style="color:Blue;">float</span>
<span style="color:Blue;">SET</span> @angle = 45.175643
<span style="color:Blue;">SELECT</span> <span style="color:#A31515;">'The SIN of the angle is: '</span> + <span style="color:Magenta;">CONVERT</span>(<span style="color:Blue;">varchar</span>,<span style="color:Magenta;">SIN</span>(@angle))
GO

<span style="color:Blue;">DECLARE</span> @myvalue <span style="color:Blue;">float</span>;
<span style="color:Blue;">SET</span> @myvalue = 1.00;
<span style="color:Blue;">WHILE</span> @myvalue &lt; 10.00
    <span style="color:Blue;">BEGIN</span>
        <span style="color:Blue;">SELECT</span> <span style="color:Magenta;">SQRT</span>(@myvalue);
        <span style="color:Blue;">SET</span> @myvalue = @myvalue + 1
    <span style="color:Blue;">END</span>;
GO

<span style="color:Blue;">SELECT</span> <span style="color:Magenta;">TAN</span>(<span style="color:Magenta;">PI</span>()/2);
</pre></div>